package cn.demoxy.component;

import java.util.concurrent.ScheduledFuture;

/**
 * @auther demo
 * @date 2022/8/26 16:29
 */
public final class ScheduledTask {


    volatile ScheduledFuture<?> future;


    /**
     * 取消定时任务
     **/
    public void cancel() {
        ScheduledFuture<?> future = this.future;
        if (future != null) {
            future.cancel(true);
        }
    }
}